package com.hl.web.fore;

import com.hl.pojo.PsychologicalTopic;
import com.hl.service.PsychologicalTopicService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/psychologicalTopic")
public class PsychologicalTopicController {
    @Autowired
    private PsychologicalTopicService service;

    @PostMapping("/add")
    public ResultEntity add(@RequestBody PsychologicalTopic psychologicalTopic){
        service.add(psychologicalTopic);
        return ResultEntity.ok();
    }

    @GetMapping("/findAll")
    public ResultEntity findAll(){
        return ResultEntity.ok(service.findAll());
    }
    @GetMapping("/findById")
    public ResultEntity findById(Integer id){
        return ResultEntity.ok(service.findById(id));
    }
    @GetMapping("/del")
    public ResultEntity del(Integer id){
        service.del(id);
        return ResultEntity.ok();
    }
}
